import React, { Component } from 'react';
import {observer} from 'mobx-react';

@observer
class Switch extends Component {
	handleSwitchColor(color){
		this.props.store.changeThemeColor(color)
	}
	render(){
		return(
			<div>
				<button
					style={{color:this.props.store.themeColor}}
					onClick={this.handleSwitchColor.bind(this,'red')}>Red</button>
				<button
					style={{color:this.props.store.themeColor}}
					onClick={this.handleSwitchColor.bind(this,'blue')}>blue</button>
			</div>
		)
	}
}

export default Switch